package com.atguigu.yjh.cart.controller;

import com.atguigu.yjh.cart.vo.name;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.ui.Model;

import java.util.UUID;

@Controller
public class GoodsConller {
    @RequestMapping("/pay")
    public String pay( name name, Model model){
        System.out.println("=======pay===============");
        System.out.println();
        System.out.println(name);

        String tradeNo = UUID.randomUUID().toString().replace("-", "");
        System.out.println("============tradeNo===============");
        System.out.println(tradeNo);
//        System.out.println(totalPrice);
//        String name = request.getParameter("name");
        System.out.println(name.getName());
        model.addAttribute("totalPrice",name.getName());
        model.addAttribute("tradeNo", tradeNo);
        model.addAttribute("name", 12345);
        return "pay";
    }
}
